import sbt.Attributed

name := "biSYNC"

version := "0.1"

scalaVersion := "2.13.7"

def project(id: String) = Project(id, base = file(id))
  .settings(
    scalaVersion := "2.13.7",
    javacOptions in compile ++= Seq(
      "-encoding", "UTF-8",
      "-source", "1.8",
      "-target", "1.8",
      "-Xlint:unchecked",
      "-Xlint:deprecation"
    ),
    scalacOptions ++= Seq(
      "-Ymacro-annotations",
      "-language:experimental.macros",
      "-deprecation"
    )
  )

lazy val utils = project("macros")
  .settings(
    version := "0.0.1",
    libraryDependencies ++= Seq(
      "org.scala-lang" % "scala-reflect" % scalaVersion.value
    )
  )

lazy val core = project(id = "core").dependsOn(utils)
  .settings(
    version := "0.0.1",
    libraryDependencies ++= Seq(
      "doobie-core",
      "doobie-specs2",
      "doobie-quill",
      "doobie-hikari",
      "doobie-h2",
    ).map("org.tpolecat" %%  _ % "1.0.0-RC1") ++ Seq(
      "mysql" % "mysql-connector-java" % "8.0.17",
      "io.getquill" %% "quill-jdbc-zio" % "3.12.0",
      "com.softwaremill.quicklens" %% "quicklens" % "1.8.2",
      "dev.zio" %% "zio-logging" % "0.5.12",
      "dev.zio" %% "zio-interop-cats" % "2.5.1.0",
      "com.beachape" %% "enumeratum-quill" % "1.7.0",
      "eu.timepit" %% "refined-pureconfig" % "0.9.27",
      "org.flywaydb" % "flyway-core" % "7.12.1",
    )
  )
